﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HMS_TabletClient
{
    public partial class SelectAddr : Form
    {
        public SelectAddr()
        {
            InitializeComponent();
        }
        public string author;
        public string[] joined;
        NewAddr f1 = new NewAddr();
        DataTable dt = new DataTable();

        private void SelectAddr_Load(object sender, EventArgs e)
        {
            dateTimePicker1.Value = System.DateTime.Now;
            dataGridView1.RowHeadersVisible = false;



            dt.Columns.Add("编号", typeof(System.String));
            dt.Columns.Add("地址", typeof(System.String));
            dt.Columns.Add("产别", typeof(System.String));
            dt.Columns.Add("完损等级评定表", typeof(System.String));
            dt.Columns.Add("安全检查技术表", typeof(System.String));
            dt.Columns.Add("平房修缮检查表", typeof(System.String));

            //DataRow dr = dt.NewRow();
            //dr[0] = "2011煤改电项目";
            //dr[1] = "西四北头条34号";
            //dr[2] = System.DateTime.Now;
            //dr[3] = "警戒线";
            //dr[4] = "合格";
            //dr[5] = System.DateTime.Now;
            //dr[6] = "张三";

            //dt.Rows.Add(dr);
            //dr = dt.NewRow();
            //dr[0] = "2011煤改电项目";
            //dr[1] = "西四北头条34号";
            //dr[2] = System.DateTime.Now;
            //dr[3] = "施工安全";
            //dr[4] = "符合要求";
            //dr[5] = System.DateTime.Now;
            //dr[6] = "张三";
            //dt.Rows.Add(dr);

            dataGridView1.DataSource = dt;
        }
        public void newaline(string id, string street, string yard)
        {
           // DataTable dt = new DataTable();
            DataRow dr = dt.NewRow();
            dr[0] = "1235678";
            dr[1] = street+" "+yard;
            dr[2] = "公房";
            dr[3] = "未完成";
            dr[4] = "未完成";
            dr[5] = "未完成";

            dt.Rows.Add(dr);
            this.Enabled = true;
        }
        public void sshow()
        {
            Author.Text+= author;
            //   Joined.Text = joined;
            for (int i = 0; i < joined.Length; i++)
            {
                Joined.Text += joined[i] + " ";
            }
        }

        private void pictureBox4_Click(object sender, EventArgs e)
        {
            edit.BackColor = Color.Transparent;
            SmallMap f2 = new SmallMap();
            f2.Show();
            f2.author = author;
            f2.joined = joined;
            f2.sshow();
            this.Hide();
            f2.FormClosed += new FormClosedEventHandler(f2_FormClosed);
        }

        void f2_FormClosed(object sender, FormClosedEventArgs e)
        {
            //throw new NotImplementedException();
            this.Show();
        }

        private void back_Click(object sender, EventArgs e)
        {
            back.BackColor = Color.Transparent;
            this.Close();
        }

        private void back_MouseDown(object sender, MouseEventArgs e)
        {

            back.BackColor = Color.LightBlue; 
        }

        private void back_MouseLeave(object sender, EventArgs e)
        {
            back.BackColor = Color.Transparent;
        }

        private void del_Click(object sender, EventArgs e)
        {
            del.BackColor = Color.Transparent;
        }

        private void del_MouseDown(object sender, MouseEventArgs e)
        {
            del.BackColor = Color.LightBlue;
        }

        private void del_MouseLeave(object sender, EventArgs e)
        {
            del.BackColor = Color.Transparent;
        }

        private void newone_MouseLeave(object sender, EventArgs e)
        {
            newone.BackColor = Color.Transparent;

        }

        private void newone_MouseDown(object sender, MouseEventArgs e)
        {
            newone.BackColor = Color.LightBlue;

        }

        private void newone_Click(object sender, EventArgs e)
        {
            newone.BackColor = Color.Transparent;
            f1.Owner = this;
       
            f1.Show();
            f1.FormClosed += new FormClosedEventHandler(f1_FormClosed);
            this.Enabled = false;
        }

        void f1_FormClosed(object sender, FormClosedEventArgs e)
        {
            f1 = new NewAddr();
            this.Enabled = true;
            //throw new NotImplementedException();
        }

        private void edit_MouseDown(object sender, MouseEventArgs e)
        {
            edit.BackColor = Color.LightBlue;
        }

        private void edit_MouseMove(object sender, MouseEventArgs e)
        {

        }

        private void edit_MouseLeave(object sender, EventArgs e)
        {
            edit.BackColor = Color.Transparent;
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void Joined_Click(object sender, EventArgs e)
        {

        }

        private void Author_Click(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {

        }
    }
}
